<template>
	<view class="app-classify-reservation-address e-flex bg-white" @tap="jump">
		<view >
			<text class="e-font-30 fw-500">{{$t('classify.上门地址')}}</text>
		</view>
		<view class="e-flex-1 text-right">
			<template v-if="info.receivingName||info.name">
				<view class="c-333 e-font-30  e-m-b-10">
					{{info.receivingAddress|| `${info.nameExt||''} ${info.address||''}`}}</view>
				<view class=" c-secondary e-font-26">
					<text class="e-m-r-20">{{info.receivingName||info.name}}</text>
					<text>{{info.receivingPhone||info.phone}}</text>
				</view>
			</template>
			<text v-if="!info.name">{{$t('classify.添加上门地址')}}</text>
		</view>
		<view class="e-m-l-6">
			<app-image src="arrow_right.png" :size="['18rpx']" />
		</view>
		
	</view>
</template>

<script setup lang="ts">
	import type { AddressItem } from '@/common/request/api'
	import { useCurrentInstance } from '@/common/hooks'
	
	const props = withDefaults(defineProps<{
		info : AddressItem
	}>(), {
		type: '2'
	})
	
	const emit = defineEmits(['update:info'])
	const handleSelectAddress = (e: AddressItem) => {
		emit('update:info',e)
	};
	const jump = () => {
		ctx.$goTo('/pages/user/receivingAddress/index', { type: 1 },{
			selectAddress:handleSelectAddress
		});
	}
</script>

<style scoped lang="scss">
	@include appBem_b(classify-reservation-address){
		padding: 30rpx 20rpx;
	}

</style>